#include "delay.h"


void delay_us(uint32_t us)
{
  us *= 12;
  --us;
  asm volatile("   mov r0, %[us] \n\t"
               "1: subs r0, #1   \n\t"
               "   bhi 1b        \n\t"
               :
               : [us] "r" (us)
               : "r0");
}

void delay_ms(uint32_t ms)
{
  while(ms--)
    delay_us(1000);
}
